package com.netease.financial.domain.interactor;

import com.netease.financial.domain.executor.PostExecutionThread;
import com.netease.financial.domain.executor.ThreadExecutor;
import com.netease.financial.domain.repository.NfsRepository;

import rx.Observable;

/**
 * Created by wyf on 8/3/15.
 */
public class GetAppUpdateInfo extends UseCase {

    private final NfsRepository mNfsRepository;

    private final String mDevice;
    private final int mCurrentVersionCode;

    public GetAppUpdateInfo(String device, int currentVersionCode, NfsRepository nfsRepository,
                            ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread) {
        super(threadExecutor, postExecutionThread);
        mDevice = device;
        mCurrentVersionCode = currentVersionCode;
        mNfsRepository = nfsRepository;
    }

    @Override
    public Observable buildUseCaseObservable() {
        return mNfsRepository.getAppUpdateInfo(mDevice, mCurrentVersionCode);
    }

}
